home *** CD-ROM | disk | FTP | other *** search
/ Clickx 23 / Clickx 23.iso / DATA / moveabletype / MT-3.2-en_US / mt-xmlrpc.cgi < prev    next >
Encoding:
Text File  |  2005-07-29  |  1.0 KB  |  39 lines

  1. #!/usr/bin/perl -w
  2.  
  3. # Copyright 2001-2005 Six Apart. This code cannot be redistributed without
  4. # permission from www.sixapart.com.  For more information, consult your
  5. # Movable Type license.
  6. #
  7. # $Id: mt-xmlrpc.cgi 15432 2005-07-29 20:41:11Z bchoate $
  8.  
  9. use strict;
  10. my $MT_DIR;
  11. sub BEGIN {
  12.     require File::Spec;
  13.     if (!($MT_DIR = $ENV{MT_HOME})) {
  14.         if ($0 =~ m!(.*[/\\])!) {
  15.             $MT_DIR = $1;
  16.         } else {
  17.             $MT_DIR = './';
  18.         }
  19.         $ENV{MT_HOME} = $MT_DIR;
  20.     }
  21.     unshift @INC, File::Spec->catdir($MT_DIR, 'lib');
  22.     unshift @INC, File::Spec->catdir($MT_DIR, 'extlib');
  23. }
  24.  
  25. use XMLRPC::Transport::HTTP;
  26. use MT::XMLRPCServer;
  27.  
  28. $MT::XMLRPCServer::MT_DIR = $MT_DIR;
  29.  
  30. {
  31.     ## Shut off warnings, because SOAP::Lite 0.55 causes some
  32.     ## unitialized value warnings that seem to be connected to
  33.     ## the soap->action
  34.     local $SIG{__WARN__} = sub { };
  35.     my $server = XMLRPC::Transport::HTTP::CGI->new;
  36.     $server->dispatch_to('blogger', 'metaWeblog', 'mt');
  37.     $server->handle;
  38. }
  39.